Integrand size = 23, antiderivative size = 165 \[ \int \frac {\cos ^2(c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx=-\frac {4 a \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 \left (2 a^2+b^2\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {a+b \cos (c+d x)}}+\frac {2 \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 b d} \]
[Out]
Time = 0.25 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {2870, 2831, 2742, 2740, 2734, 2732} \[ \int \frac {\cos ^2(c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx=\frac {2 \left (2 a^2+b^2\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {a+b \cos (c+d x)}}-\frac {4 a \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{3 b d} \]
[In]
[Out]
Rule 2732
Rule 2734
Rule 2740
Rule 2742
Rule 2831
Rule 2870
Rubi steps \begin{align*} \text {integral}& = \frac {2 \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 b d}+\frac {2 \int \frac {\frac {b}{2}-a \cos (c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx}{3 b} \\ & = \frac {2 \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 b d}+\frac {1}{3} \left (1+\frac {2 a^2}{b^2}\right ) \int \frac {1}{\sqrt {a+b \cos (c+d x)}} \, dx-\frac {(2 a) \int \sqrt {a+b \cos (c+d x)} \, dx}{3 b^2} \\ & = \frac {2 \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 b d}-\frac {\left (2 a \sqrt {a+b \cos (c+d x)}\right ) \int \sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}} \, dx}{3 b^2 \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {\left (\left (1+\frac {2 a^2}{b^2}\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}}\right ) \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}} \, dx}{3 \sqrt {a+b \cos (c+d x)}} \\ & = -\frac {4 a \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 \left (1+\frac {2 a^2}{b^2}\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )}{3 d \sqrt {a+b \cos (c+d x)}}+\frac {2 \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{3 b d} \\ \end{align*}
Time = 0.54 (sec) , antiderivative size = 137, normalized size of antiderivative = 0.83 \[ \int \frac {\cos ^2(c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx=\frac {-4 a (a+b) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )+2 \left (2 a^2+b^2\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),\frac {2 b}{a+b}\right )+2 b (a+b \cos (c+d x)) \sin (c+d x)}{3 b^2 d \sqrt {a+b \cos (c+d x)}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(452\) vs. \(2(207)=414\).
Time = 4.11 (sec) , antiderivative size = 453, normalized size of antiderivative = 2.75
method | result | size |
default | \(-\frac {2 \sqrt {\left (2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (4 \left (\cos ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+2 \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -6 \left (\cos ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+2 a^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right )+b^{2} \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right )-2 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a^{2}+2 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {\frac {2 b \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a -b}{a -b}}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {-\frac {2 b}{a -b}}\right ) a b -2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) a b +2 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{2}\right )}{3 b^{2} \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +\left (a +b \right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 b \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b}\, d}\) | \(453\) |
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.12 (sec) , antiderivative size = 398, normalized size of antiderivative = 2.41 \[ \int \frac {\cos ^2(c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx=\frac {-6 i \, \sqrt {2} a b^{\frac {3}{2}} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) + 6 i \, \sqrt {2} a b^{\frac {3}{2}} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) + 6 \, \sqrt {b \cos \left (d x + c\right ) + a} b^{2} \sin \left (d x + c\right ) + \sqrt {2} {\left (-4 i \, a^{2} - 3 i \, b^{2}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) + \sqrt {2} {\left (4 i \, a^{2} + 3 i \, b^{2}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )}{9 \, b^{3} d} \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx=\int \frac {\cos ^{2}{\left (c + d x \right )}}{\sqrt {a + b \cos {\left (c + d x \right )}}}\, dx \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx=\int { \frac {\cos \left (d x + c\right )^{2}}{\sqrt {b \cos \left (d x + c\right ) + a}} \,d x } \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx=\int { \frac {\cos \left (d x + c\right )^{2}}{\sqrt {b \cos \left (d x + c\right ) + a}} \,d x } \]
[In]
[Out]
Time = 14.34 (sec) , antiderivative size = 116, normalized size of antiderivative = 0.70 \[ \int \frac {\cos ^2(c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx=\frac {2\,\sin \left (c+d\,x\right )\,\sqrt {a+b\,\cos \left (c+d\,x\right )}}{3\,b\,d}+\frac {2\,\sqrt {\frac {a+b\,\cos \left (c+d\,x\right )}{a+b}}\,\left (\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |\frac {2\,b}{a+b}\right )\,\left (2\,a^2+b^2\right )-2\,a\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |\frac {2\,b}{a+b}\right )\,\left (a+b\right )\right )}{3\,b^2\,d\,\sqrt {a+b\,\cos \left (c+d\,x\right )}} \]
[In]
[Out]